Caption = " To Print the clipboard just PASTE something to the clipboard and then DOUBLE-CLICK the ICON "
Height = 588
Index = 2
Left = 96
TabIndex = 2
Top = 2400
Width = 5004
End
Begin Label Explination
Caption = "To print the clipboard without first being prompted just turn off the 'Prompt before Print' checkbox. IF you then want to return to this configuration screen just 'Double click' the ICON with NOTHING in the Clipboard. "
Height = 972
Index = 1
Left = 96
TabIndex = 1
Top = 1248
Width = 5004
End
Begin Label Explination
Caption = " 1)TEXT 2)BITMAP 3)D.I.B."
Height = 300
Index = 3
Left = 96
TabIndex = 7
Top = 768
Width = 5004
End
Begin Label Explination
Caption = "This utility will print the contents of the Windows clipboard. It can print Three types of data from the clipboard: "
Height = 588
Index = 0
Left = 96
TabIndex = 0
Top = 96
Width = 5004
End
Sub CancelButton_Click ()
PrintCB.Windowstate = WS_MINIMIZED
End Sub
Sub Form_Load ()
PrintCB.Windowstate = WS_MINIMIZED
OKtoPrint = False
End Sub
Sub Form_Resize ()
Dim TextToPrint$
If PrintCB.Windowstate = WS_NORMAL Then
If PrintCB.PromptBeforePrint.value = False Then
rc = Printit()
If rc = 0 Then
PrintCB.Windowstate = WS_MINIMIZED
End If
Else
CBType = GetClipboardType()
If CBType Then
PrintCB.PrintButton.visible = True
PrintCB.Message.caption = " OK to Print: " + TypeDescription + "?"
Else
PrintCB.PrintButton.visible = False
PrintCB.Message.caption = " No valid data in Clipboard!"
End If
End If
End If
End Sub
Function GetClipboardType () As Integer
If Clipboard.GetFormat(CF_DIB) And TextOnly.value = False Then
GetClipboardType = CF_DIB
TypeDescription = "D.I.B"
ElseIf Clipboard.GetFormat(CF_BITMAP) And TextOnly.value = False Then
GetClipboardType = CF_BITMAP
TypeDescription = "Bitmap"
ElseIf Clipboard.GetFormat(CF_TEXT) Then
GetClipboardType = CF_TEXT
TypeDescription = "Text"
GetClipboardType = 0
End If
End Function
Sub PrintButton_Click ()
a = b
rc = Printit()
End Sub
Function Printit () As Integer
'0 = OK
'1 = Error
Printit = 0
On Error GoTo Printit_Error
CBType = GetClipboardType()
Select Case CBType
Case CF_TEXT
TextToPrint$ = Clipboard.GetText(CF_TEXT)
Printer.Print TextToPrint$
Printer.EndDoc
PrintCB.Windowstate = WS_MINIMIZED
Case CF_BITMAP
PrintPIC.Show
PrintPIC.Windowstate = WS_MAXIMIZED
PrintPIC.Picture = Clipboard.GetData(CF_BITMAP)
PrintPIC.PrintForm
Printer.EndDoc
Unload PrintPIC
PrintCB.Windowstate = WS_MINIMIZED
Case CF_DIB
PrintPIC.Windowstate = WS_MAXIMIZED
PrintPIC.Picture = Clipboard.GetData(CF_DIB)
PrintPIC.PrintForm
Printer.EndDoc
Unload PrintPIC
PrintCB.Windowstate = WS_MINIMIZED
Case Else
Printit = 1
PrintCB.Message.caption = "No valid data in clipboard"
PrintCB.PrintButton.visible = False
End Select
Exit Function
Printit_Error:
Debug.Print Str$(Err), Error$(Err)
Printit = 1
PrintCB.Message.caption = "An Error occured during print"